﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DGM.Objects.General
{
	public static class TickerExtensions
	{
		public static string[] Tickers = new[]
			{
				//"BIEBER",
				//"OBAMA",
				//"GAGA",
				"$GOOG",
				"$AMZN",
				"$EBAY",
				"$TFM",
				"$LF",
				"$FB",
				"$IWM",
				"$YELP",
				"$GPS",
				"$GM",
				"$MSFT"
			};

		public static string[] TickerNames = new[]
			{
				//"Justin Bieber",
				//"Barack Obama",
				//"Lady Gaga",
				"Google",
				"Amazon",
				"eBay",
				"The Fresh Market",
				"LeapFrog Enterprises",
				"Facebook",
				"iShares Russell 2000 Index",
				"Yelp",
				"Gap",
				"General Motors",
				"Microsoft"
			};

		public static string TickerDescription(string ticker)
		{
			return TickerNames[Array.IndexOf(Tickers, ticker)];
		}

	public static string GetTickers(this string message)
		{
			message = message.ToUpper();
			var tickers = (from ticker in Tickers where message.Contains(ticker) select ticker).FirstOrDefault();
		return tickers;

		}

		public static string TickerList()
		{
			var result = string.Join(",", Tickers);
			return result;
		}
	}
}
